package com.bifrost.cbentity;

import javax.persistence.*;

/**
 * @author rangf
 * @date 2018/2/27
 */
@Entity
@Table(name = "BHWSC_GYS")
public class SapPartner {
    private String lifnr;
    private String name1;
    private String ktokk;
    private String dstatus;
    private String ddate;
    private Long noid;

    @Basic
    @Column(name = "LIFNR", nullable = true, length = 10)
    public String getLifnr() {
        return lifnr;
    }

    public void setLifnr(String lifnr) {
        this.lifnr = lifnr;
    }

    @Basic
    @Column(name = "NAME1", nullable = true, length = 70)
    public String getName1() {
        return name1;
    }

    public void setName1(String name1) {
        this.name1 = name1;
    }

    @Basic
    @Column(name = "KTOKK", nullable = true, length = 4)
    public String getKtokk() {
        return ktokk;
    }

    public void setKtokk(String ktokk) {
        this.ktokk = ktokk;
    }

    @Basic
    @Column(name = "DSTATUS", nullable = true, length = 1)
    public String getDstatus() {
        return dstatus;
    }

    public void setDstatus(String dstatus) {
        this.dstatus = dstatus;
    }

    @Basic
    @Column(name = "DDATE", nullable = true, length = 14)
    public String getDdate() {
        return ddate;
    }

    public void setDdate(String ddate) {
        this.ddate = ddate;
    }

    @Id
    @SequenceGenerator(name= "sequence",sequenceName="sequence_partner" ,allocationSize=1)
    @GeneratedValue(generator= "sequence",strategy= GenerationType.SEQUENCE)
    @Column(name = "NOID", nullable = false, precision = 0)
    public Long getNoid() {
        return noid;
    }

    public void setNoid(Long noid) {
        this.noid = noid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SapPartner that = (SapPartner) o;

        if (noid != that.noid) return false;
        if (lifnr != null ? !lifnr.equals(that.lifnr) : that.lifnr != null) return false;
        if (name1 != null ? !name1.equals(that.name1) : that.name1 != null) return false;
        if (ktokk != null ? !ktokk.equals(that.ktokk) : that.ktokk != null) return false;
        if (dstatus != null ? !dstatus.equals(that.dstatus) : that.dstatus != null) return false;
        if (ddate != null ? !ddate.equals(that.ddate) : that.ddate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = lifnr != null ? lifnr.hashCode() : 0;
        result = 31 * result + (name1 != null ? name1.hashCode() : 0);
        result = 31 * result + (ktokk != null ? ktokk.hashCode() : 0);
        result = 31 * result + (dstatus != null ? dstatus.hashCode() : 0);
        result = 31 * result + (ddate != null ? ddate.hashCode() : 0);
        result = 31 * result + (int) (noid ^ (noid >>> 32));
        return result;
    }
}
